https://glot.io/snippets/ghlevs2f0y/raw/main.lua